#include <iostream>
#include <vector>
#include <unordered_map>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define endl '\n'
const int N = 2e5 + 10;
const int MOD = 100003;

int dp[N];
int n, k;

void solve() 
{
    cin >> n >> k;
    dp[0] = 1;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= k && i - j >= 0; j++)
        {
            dp[i] += dp[i - j];
            dp[i] %= MOD;
        }
    }    
    cout << dp[n] << endl;
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int T = 1;
	// cin >> T;
	while(T--)
	{
        solve();
	}
	return 0;
}